//
//  JLAdViewController.m
//  LIangeNews
//
//  Created by sun on 16/1/10.
//  Copyright © 2016年 sun. All rights reserved.
//

#import "JLAdViewController.h"
#import "UIView+Frame.h"
#import "JLMainTabBarController.h"
@interface JLAdViewController ()

@end

@implementation JLAdViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //1. 设置背景图片
    UIImageView * backgroundImageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"Default"]];
    backgroundImageView.frame = self.view.bounds;
    [self.view addSubview:backgroundImageView];
    //2. 设置广告图片
    UIImageView * adImageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"ad"]];
    adImageView.width = 306;
    adImageView.height = 310;
    adImageView.centerX = self.view.width * 0.5;
    adImageView.centerY = self.view.height * 0.4;
    [self.view addSubview:adImageView];
    //3. 延迟两秒执行
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        UIWindow * window = [[UIApplication sharedApplication] keyWindow];
        JLMainTabBarController * mainTabBar = [[JLMainTabBarController alloc]init];
        window.rootViewController = mainTabBar;
    });
    
    
    
}

@end
